AECoerceDesc
AECoerceDesc Coerce data in descriptor record to descriptor type
#include <AppleEvents.h> Apple Event Manager
OSErr AECoerceDesc( theAEDesc, toType, result );
AEDesc * theAEDesc ; descriptor record of data to be coerced
DescType toType ; pointer to descriptor type
AEDesc * result ; resulting descriptor record
returns Error Code; 0 = no error
The AECoerceDesc function coerces the data in a descriptor record to
another descriptor type.
The parameter theAEDesc is the descriptor record whose data is to be coerced.
The toType parameter is the desired descriptor type of the resulting
descriptor record.
The AECoerceDesc function returns in the result parameter the resulting
descriptor record. This function creates a new descriptor record by copying
the descriptor record from the input parameter. Your application is
responsible for using the AEDisposeDesc function to dispose of the resulting
descriptor record once you are finished using it.
If the function returns a nonzero result code, a descriptor record with the
typeNull descriptor type is returned. A descriptor record of this type does not
contain any data.
Note: To avoid infinite recursion, AECoerceDesc must never be called by
an application-supplied coercion routine.
Result codes
noErr (0) No error

Notes: Although you do need to allocate space for the AEDesc record that you pass
in the result parameter, it is not necessary to call AECreateDesc in order
to create a descriptor record for the result parameter. The
AECoerceDesc function takes care of creating the result
descriptor record.
Your application is responsible for disposing of both the input
descriptor record, theAEDesc and the resulting descriptor record, result
using AEDisposeDesc. See
Disposing of Apple Event Data Structures for more information on
when your application is responsible for disposing of Apple event data
structures.